Skip to main content

barcodeLibraryDetect

Type

handler

Summary

Returns any barcodes of the given formats detected in an image.

Syntax

barcodeLibraryDetect(<pImage>,<pFormats>)

Description

Use barcodeLibraryDetect to scan an image for barcodes of the given formats.

barcodeLibraryDetect returns an array of all the barcodes detected in the image. Each barcode is an array itself, with the following keys:

  • format: The barcode format. One of:
    - contact information
- email
- isbn
- phone number
- product code
- sms
- text
- url
- wifi
- geo point
- calendar event
- driver license
- unknown
- value format: The format of the barcode\'s value. One of:
- Aztec
- Codabar
- Code 39
- Code 93
- Code 128
- Data Matrix
- EAN 8
- EAN 13
- ITF
- PDF 417
- QR Code
- UPC A
- UPC E
- unknown
- raw value: The barcode\'s value as it was encoded in the barcode.
- display value: The barcode\'s value formatted for display.
- parsed value: An array containing the fully formatted barcode value.
- snapshot: An array containing the barcode\'s snapshot data. The keys are:
- width: The width in pixels of the snapshot
- height: The height in pixels of the snapshot
- pixels: The raw pixels of the snapshot

Parameters

NameTypeDescription

pImage

The binary data of the image to be scanned for barcodes.

pFormats

A comma separeted the list of barcode formats to detect.

If empty, all barcodes formats will be detected.

The formats recognized are:

  • Aztec
  • Codabar
  • Code 39
  • Code 93
  • Code 128
  • Data Matrix
  • EAN 8
  • EAN 13
  • ITF
  • PDF 417
  • QR Code
  • UPC A
  • UPC E

Examples

    local tBarcodes
put barcodeLibraryDetect(the text of image 1, empty) \
into tBarcodes
repeat for each element tBarcode in tBarcodes
answer "Barcode" && tBarcode["display value"] && "found"
end repeat
    local tBarcodes
put barcodeLibraryDetect(URL "binfile:barcodes.png", \
"EAN 13, QR Code") into tBarcodes

Compatibility and Support

OS

android